package com.hippo.core.ui.compose.splash

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.navigation.NavController
import com.hippo.core.core.UserManger
import com.hippo.core.ui.navigation.AppRoute

@Composable
fun SplashScreen(navController: NavController) {

    LaunchedEffect(Unit) {

        if(UserManger.isLogin()){
            navController.navigate(AppRoute.MAIN){
                popUpTo(AppRoute.SPLASH){
                    inclusive = true
                }
            }
        }else{
            navController.navigate(AppRoute.LOGIN){
                popUpTo(AppRoute.SPLASH){
                    inclusive = true
                }
            }
        }


    }





}
